import time
import math
WIDTH = 800
HEIGHT = 800

BACK_COLOR = (0, 0, 0)
FPS = ""
lastTime = time.time()
lastUpdateTime = time.time()

def update():
    global lastTime, lastUpdateTime
    #print("time.time():", time.time())
    accumTime = time.time() - lastUpdateTime
    
    t = time.time() - lastTime
    lastTime = time.time()
    
    if accumTime > 5:
        FPS = "FPS:" + str(math.floor(1/t))
        print(FPS)
        lastUpdateTime = time.time()
    